package com.nineclock.system.feign;

import com.nineclock.common.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("sys-service")
public interface OrganizationFeign {
    /**
     * 通过个人id查询部门
     * @param companyUserId
     * @return
     */
    @GetMapping("/department/queryDepartmentsByUserId")
    public Result<List<Long>> queryDepartmentsByUserId(@RequestParam("companyUserId") Long companyUserId);

    /**
     * 该公司的顶级部门们
     * @return
     */
    @GetMapping("/organization/department/top")
    public Result<List<Long>> queryDepartmentIds();
    /**
     * 指定部门(们)下属所以员工人数
     */
    @GetMapping("/organization/department/membernum")
    public Result<Integer> queryUserCountByDepartmentIds(
            @RequestParam("departmentIds") List<Long> departmentIds);
}
